FROM alpine:supervisord

MAINTAINER Bridge <jaikuai@163.com>

#RUN install subversion
RUN apk add subversion

# ENV
ENV USER="svn"
ENV PASS="svn"

RUN mkdir /data \
	&& svnadmin create /data \
	&& echo "[users]" > /data/conf/passwd \
	&& echo "$USER = $PASS" >> /data/conf/passwd \
	&& echo "[/]" > /data/conf/authz \
	&& echo "$USER = rw" >> /data/conf/authz

ADD ./etc/svnserve.conf /data/conf/svnserve.conf

# Archives and configuration are stored in /svn
VOLUME ["/data"]

# Expose public port for svnserve
EXPOSE 3690

COPY supervisord-svn.conf /etc/supervisor.conf.d/supervisord-svn.conf
